{% include 'head.html' %}








<body>


<div id="over" class="overLoading"></div>
<div id="layout" class="layoutLoading"></div>


  <!-- 最为层容器 -->
  <div class="jd_container">
    <!-- 顶部 -->
    <div class="jd_header" style="height: 50px;background: #dce2ec;width: 100%">

      <!--<span style="float: left;margin-left: -18%;margin-top: 15px;">货比三家</span>-->
      <a href="/" >
        <div style="width: 10%;margin-left: -20%;">
        <span style="float: left;margin-top: 12px;font-size: 23px;color: #000;">
          <i class="fa fa-chevron-left">
          </i>
        </span>
        </div>
      </a>
      
      <div style="text-align:center;margin-top: 5%;float: left;width: 90%;">
        <span style="font-size: 19px;">批发信息</span>
      </div>

       <a href="/flpg" >
        <div style="margin-right: -15%;float: right;margin-top: 12px;">
        <span style="font-size: 23px;color: #000;top:0;">
          <i class="fa fa-search">
          </i>
        </span>
      </div>
      </a>
    </div>

     
<div>
    

    
    
      
<div style="width: 100%;height: 50px;" ></div>



<div id="top1" style="width: 100%;height: 35px;margin-bottom: 5%;">

  {% if all %}
      <div style="width: 25%;height: 35px;border:1px solid #F5F5F5;border-bottom: 2px solid #F00;float: left;text-align: center;background-color: #f8f8ff;">
        <h5 style="color: #000;">全部</h5>
      </div>
  {% else %}
    <a href="/pifainfo">
      <div style="width: 25%;height: 35px;border:1px solid #F5F5F5;float: left;text-align: center;background-color: #fff;">
        <h5 style="color: #000;">全部</h5>
      </div>
    </a>
  {% endif %}

  {% if jxpf %}
    <div style="width: 25%;height: 35px;border:1px solid #F5F5F5;border-bottom: 2px solid #F00;float: left;text-align: center;background-color: #f8f8ff;">
      <h5>经销批发</h5>
    </div>
  {% else %}
    <a href="/pifainfo?gettype=jxpf">
      <div style="width: 25%;height: 35px;border:1px solid #F5F5F5;float: left;text-align: center;background-color: #fff;">
        <h5 style="color: #000;">经销批发</h5>
      </div>
    </a>
  {% endif %}

  {% if scjg %}
    <div style="width: 25%;height: 35px;border:1px solid #F5F5F5;border-bottom: 2px solid #F00;float: left;text-align: center;background-color: #f8f8ff;">
      <h5>生产加工</h5>
    </div>
  {% else %}
    <a href="/pifainfo?gettype=scjg">
      <div style="width: 25%;height: 35px;border:1px solid #F5F5F5;float: left;text-align: center;background-color: #fff;">
        <h5 style="color: #000;">生产加工</h5>
      </div>
    </a>
  {% endif %}

  {% if zsdl %}
    <div style="width: 25%;height: 35px;border:1px solid #F5F5F5;border-bottom: 2px solid #F00;float: left;text-align: center;background-color: #f8f8ff;">
      <h5>招商代理</h5>
    </div>
  {% else %}
    <a href="/pifainfo?gettype=zsdl">
      <div style="width: 25%;height: 35px;border:1px solid #F5F5F5;float: left;text-align: center;background-color: #fff;">
        <h5 style="color: #000;">招商代理</h5>
      </div>
    </a>
  {% endif %}

</div>


{% if all %}
  <script type="text/javascript">
    function next_pf(qnumber){
      console.log('下拉请求');
      get_api_ajax2("getpifaDatas?numb="+qnumber,pfshow);
    }

  </script>
{% endif %}

{% if jxpf %}
  <script type="text/javascript">
    function next_pf(qnumber){
      console.log('下拉请求');
      get_api_ajax2("getpifaDatas?gettype=jxpf&numb="+qnumber,pfshow);
    }
    
  </script>
{% endif %}

{% if scjg %}
  <script type="text/javascript">
    function next_pf(qnumber){
      console.log('下拉请求');
      get_api_ajax2("getpifaDatas?gettype=scjg&numb="+qnumber,pfshow);
    }
    
  </script>
{% endif %}

{% if zsdl %}
  <script type="text/javascript">
    function next_pf(qnumber){
      console.log('下拉请求');
      get_api_ajax2("getpifaDatas?gettype=zsdl&numb="+qnumber,pfshow);
    }
    
  </script>
{% endif %}





<script type="text/javascript">



  function codtemp(names,links,imglink,price,flei,shopname,shoptype,shopsite){
    var cod_temps = '<div style="width: 46%;height: 310px;border-style: solid; border-width: 1px;float: left;margin-left: 2.5%;margin-top: 12px;margin-bottom: 8px;">\
    <a href="'+links+'">\
    <div style="width: 100%;height: 150px;text-align: center;">\
      <img src="'+imglink+'" style="width: 100%;height: 150px;">\
    </div>\
    <div style="width: 100%;height: 35px;text-align: center;border-bottom-style: solid; border-width: 1px;border-color:red;text-overflow:ellipsis;">\
      '+names+'\
    </div>\
    </a>\
    <div style="text-align: center;">\
      <table style="width: 100%;" class="table table-bordered">\
        <tr>\
          <td style="width: 40%;padding:0px;">价格</td>\
          <td style="width: 60%;padding:0px;">'+price+'</td>\
        </tr>\
        <tr>\
          <td style="width: 40%;padding:0px;">分类</td>\
          <td style="width: 60%;padding:0px;">'+flei+'</td>\
        </tr>\
        <tr>\
          <td style="width: 40%;padding:0px;">公司</td>\
          <td style="width: 60%;padding:0px;">'+shopname+'</td>\
        </tr>\
        <tr>\
          <td style="width: 40%;padding:0px;">经营类型</td>\
          <td style="width: 60%;padding:0px;">'+shoptype+'</td>\
        </tr>\
        <tr>\
          <td style="width: 40%;padding:0px;">公司位置</td>\
          <td style="width: 60%;padding:0px;">'+shopsite+'</td>\
        </tr>\
      </table>\
    </div>\
  </div>';
    return  cod_temps;
  }



  function pfshow(datas){
    //console.log(datas);
    getkeys = true;
    var jsondatas = JSON.parse(datas);
    //alert(jsondatas);
    //alert(typeof(jsondatas));
    console.log(jsondatas);
    for(datasinfo in jsondatas){
      //console.log(jsondatas[datasinfo]);
      var infos = jsondatas[datasinfo];
      //console.log(infos);
      /*
      console.log(infos[0]);
      console.log(infos[1]);
      console.log(infos[2]);
      console.log(infos[3]); 
      console.log(infos[4]); 
      console.log(infos[5]); 
      console.log(infos[6]); 
      console.log(infos[7]); 
      */

      //cod_name,cod_link,cod_img,cod_price,fenlei,shop_type,shop_name,shop_site

      //names,links,imglink,price,flei,shopname,shoptype,shopsite
      $("#more").append(codtemp(infos[0],
                                infos[1],
                                infos[2],
                                infos[3],
                                infos[4],
                                infos[6],
                                infos[5],
                                infos[7]
                                ));
      

    }
  }


  



  var top=$("#top1").offset().top;

  var qnumber = 1;

  var getkeys = true;

  $(window).scroll(function () {
   if ($(window).scrollTop() >= 140) {
      $("#top1").attr("style", "overflow: hidden;position:fixed;top:50px;left:0;z-index:90;width:100%;");
    } else {
       $("#top1").attr("style", "overflow: hidden; height: 35px;width:100%;");
    }

    //下拉刷新
    console.log(getScrollTop());
    console.log(getClientHeight());
    console.log(getScrollHeight());
    if(getScrollTop() + getClientHeight()+50 >= getScrollHeight()) {
          if(getkeys){
            getkeys = false;
            console.log('下拉刷新了');
            //此处发起AJAX请求
            //alert("下拉刷新了");
            qnumber+=1;

            next_pf(qnumber);
          }
      }


  }).trigger("scroll");
</script>






<!-- cod_name,cod_link,cod_img,cod_price,fenlei,shop_type,shop_name,shop_site  -->

{% for datainfo in infolist %}
  

  <div style="width: 46%;height: 310px;border-style: solid; border-width: 1px;float: left;margin-left: 2.5%;margin-top: 12px;margin-bottom: 8px;">
    
    <a href="{{ datainfo[1] }}">
    <div style="width: 100%;height: 150px;text-align: center;">
      <img src="{{ datainfo[2] }}" style="width: 100%;height: 150px;">
    </div>
    <div style="width: 100%;height: 35px;text-align: center;border-bottom-style: solid;border-top-style: solid; border-width: 1px;border-color:red;text-overflow:ellipsis;">
      {{ datainfo[0] }}
    </div>
    </a>

    <div style="text-align: center;">
      <table style="width: 100%;" class="table table-bordered">
        <tr>
          <td style="width: 40%;padding:0px;">价格</td>
          <td style="width: 60%;padding:0px;">{{ datainfo[3] }}</td>
        </tr>

        <tr>
          <td style="width: 40%;padding:0px;">分类</td>
          <td style="width: 60%;padding:0px;">{{ datainfo[4] }}</td>
        </tr>

        <tr>
          <td style="width: 40%;padding:0px;">公司</td>
          <td style="width: 60%;padding:0px;">{{ datainfo[6] }}</td>
        </tr>

        <tr>
          <td style="width: 40%;padding:0px;">经营类型</td>
          <td style="width: 60%;padding:0px;">{{ datainfo[5] }}</td>
        </tr>

        <tr>
          <td style="width: 40%;padding:0px;">公司位置</td>
          <td style="width: 60%;padding:0px;">{{ datainfo[7] }}</td>
        </tr>

      </table>
    </div>

  </div>
  
{% endfor %}


<div id="more"></div>







<br>
<div id="lodinggo">
    <img style="width: 100%;height: 150px;" src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1559654212283&di=a780121fd32955065b060b885c7dc0b9&imgtype=0&src=http%3A%2F%2Fhbimg.b0.upaiyun.com%2F03937de50fab17a88fcb6039242de0cf89657b472a98a-7EtXD9_fw658">
</div>





    










{% include 'foot_sp.html' %}